@import "./color.scss";

/* 清除浮动 */
.clearfix {
  &::after {
    content: "";
    display: block;
    clear: both;
  }
}

.nowrap {
  white-space: nowrap;
}

/* 文本溢出省略号 */
.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ellipsis-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.inline-block {
  display: inline-block;
}

/* 常用flex布局类 */
.flex {
  display: flex;
}

.flex_aic {
  display: flex;
  align-items: center;
}

.flex_jcc {
  display: flex;
  justify-content: center;
}

.flex_aic_jcc {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex_aic_jcsb {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex_aic_jcs {
  display: flex;
  align-items: center;
  justify-content: start;
}

.flex_fdc {
  display: flex;
  flex-direction: column;
}

.flex_fdc_aic {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flex_fdc_jcsb {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flex_fdc_aic_jcc {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.flex-grow-0 {
  flex-grow: 0;
}

.justify-end {
  justify-content: flex-end;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.flex1 {
  flex: 1;
}

/* 禁用文本选择 */
.no-select {
  user-select: none;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;

  &:hover {
    background: #a8a8a8;
  }
}

// 边距
@for $i from 0 through 40 {
  .m-#{$i} {
    margin: $i * 1px;
  }

  .mt#{$i} {
    margin-top: $i * 1px;
  }

  .mb#{$i} {
    margin-bottom: $i * 1px;
  }

  .ml#{$i} {
    margin-left: $i * 1px;
  }

  .mr#{$i} {
    margin-right: $i * 1px;
  }
}

// 内边距
@for $i from 0 through 40 {
  .p#{$i} {
    padding: $i * 1px;
  }

  .pl#{$i} {
    padding-left: $i * 1px;
  }

  .pr#{$i} {
    padding-right: $i * 1px;
  }

  .pt#{$i} {
    padding-top: $i * 1px;
  }

  .pb#{$i} {
    padding-bottom: $i * 1px;
  }
}

// 字体大小
@for $i from 12 through 40 {
  .fs-#{$i} {
    font-size: $i * 1px;
  }
}

// bottom
@for $i from 0 through 40 {
  .bottom-#{$i} {
    bottom: $i * 1px;
  }
}

// right
@for $i from 0 through 40 {
  .right-#{$i} {
    right: $i * 1px;
  }
}

// left
@for $i from 0 through 40 {
  .left-#{$i} {
    left: $i * 1px;
  }
}

// top
@for $i from 0 through 40 {
  .top-#{$i} {
    top: $i * 1px;
  }
}

// gap
@for $i from 0 through 20 {
  .gap-#{$i * 2} {
    gap: $i * 2px;
  }
}

// 行高
@for $i from 10 through 40 {
  .lht-#{$i} {
    line-height: $i * 1px;
  }
}

.font-bold {
  font-weight: bold;
}

.font-normal {
  font-weight: normal;
}

.font-light {
  font-weight: lighter;
}

.font-500 {
  font-weight: 500;
}

.font-600 {
  font-weight: 600;
}

.font-700 {
  font-weight: 700;
}

.cursor-pointer {
  cursor: pointer;
}

// 颜色
.color-white {
  color: #fff;
}

.color-555555 {
  color: #555555;
}

.color-333333 {
  color: #333333;
}

.color-666666 {
  color: #666666;
}

.color-999999 {
  color: #999999;
}

.color-ff2b4e {
  color: #ff2b4e;
}

// 定位
.absolute {
  position: absolute;
}

.relative {
  position: relative;
}

.operationBtn {
  display: flex;
  align-items: center;
  padding-right: 5px;

  &::after {
    content: "";
    display: block;
    width: 1px;
    height: 12px;
    background: #ddd;
    margin-left: 5px;
  }
}

.overflow-auto {
  overflow: auto;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-y-auto {
  overflow-y: auto;
}

.overflow-x-auto {
  overflow-x: auto;
}

.overflow-y-hidden {
  overflow-y: hidden;
}

.overflow-x-hidden {
  overflow-x: hidden;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

// float
.float-left {
  float: left;
}

.float-right {
  float: right;
}

// 其他
.toolbar {
  width: 100%;
  height: 42px;
  margin-bottom: 5px;
  background: #ebf3ff;
}

.line-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-1 {
  // display: -webkit-box;
  // -webkit-box-orient: vertical;
  // -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// 宽度
.w-160 {
  width: 160px;
}

// 自定义表格
// 自定义表格
.custom-table {
  border-top: 1px solid #f2f2f2;
  border-left: 1px solid #f2f2f2;

  .custom-table-row {
    display: flex;
    // align-items: center;
    min-height: 72px;

    .custom-table-label {
      border-right: 1px solid #f2f2f2;
      border-bottom: 1px solid #f2f2f2;
      background: #f9f9f9;
      padding: 12px 15px;
      display: flex;
      align-items: center;
      justify-content: flex-end;

      &.required {
        &::before {
          content: "*";
          color: #ff2b4e;
        }
      }
    }

    .custom-table-value {
      padding: 12px 20px;
      border-bottom: 1px solid #f2f2f2;
      border-right: 1px solid #f2f2f2;
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;

      ::v-deep(.el-form-item) {
        margin-bottom: 0;
      }
    }
  }
}

.el-dropdown {
    * {
        outline: none !important;
    }
}
